package com.bdqn.cloud.t320.controller;

import com.bdqn.cloud.t320.entity.Dto;
import com.bdqn.cloud.t320.entity.DtoUtil;
import com.bdqn.cloud.t320.service.UserService;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;

@RestController
@RefreshScope
public class IndexController {
    @Resource
    UserService userService;

    @Value("${uuser.uname}")
    public String uuser;

    @RequestMapping(value = "/getuser")
    public Dto getuser() {
        System.out.println("8001");
        return DtoUtil.returnSuccess("成功", uuser);
    }

    //网络资源
    @RequestMapping(value = "/list")
    public Dto list() {
        System.out.println("8001");
        return DtoUtil.returnSuccess("成功", userService.getUserListBiz());
    }

}
